import { Request, Response } from 'express';

// mock tableListDataSource
const dataSource: any[] = [];

for (let i = 0; i < 10; i += 1) {
  dataSource.push({
    id: 123 + i,
    name: '错取件',
    status: 1,
    statusName: '已启用',
    isPrint: 1,
    printName: '不可签收',
    craeteUser: '小新',
    updateUser: '小强',
    craeteTime: '2020-1-1 12:12:12',
    updateTime: '2020-1-1 12:12:12',
  });
}

function getProblemList(req: Request, res: Response, u: string) {
  const result = {
    code: 0,
    message: 'success',
    body: {
      count: 56,
      list: dataSource,
    },
  };

  return res.json(result);
}

export default {
  'GET /type/list': getProblemList,
};
